﻿Imports BUS
Imports DTO
Imports System.Data.OleDb

Public Class frmlaythongtinsach

    Private Sub btndoc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndoc.Click
        Dim op As New OpenFileDialog()
        op.Filter = "Mo file: .xls|*.xls"
        If op.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Dim path As String = op.FileName
            Dim sql As String = "SELECT * FROM [Sheet1$]"
            Dim dao As New SachBUS()
            Dim dt As DataSet = dao.DocFileExcel(sql, path)
            dtgvdssach.DataSource = dt.Tables("Sheet1")
        End If
        
    End Sub

    Private Sub btnluu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnluu.Click
        Dim table As New DataTable()
        table = dtgvdssach.DataSource
        Dim buss As New SachBUS()
        Dim kq As Integer = buss.LuuFileExcelVaoCSDL(table)
    End Sub

    Private Sub frmlaythongtinsach_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class